﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPage/User.Master"
    CodeBehind="AdvertiseNew.aspx.vb" Inherits="GoodAnotApp.AdvertiseNew" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="Styles/jquery-ui-1.8.17.custom.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        #apContent
        {
            left: 43% !important;
        }
        #sideContent
        {
            left: 44% !important;
        }
        .alert
        {
            padding: 8px 35px 8px 14px;
            margin-bottom: 18px;
            text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
            background-color: #fcf8e3;
            border: 1px solid #fbeed5;
            -webkit-border-radius: 4px;
            -moz-border-radius: 4px;
            border-radius: 4px;
        }
        .alert, .alert-heading
        {
            color: #c09853;
        }
        .alert .close
        {
            position: relative;
            top: -5px;
            right: -21px;
            line-height: 18px;
        }
        .alert-success
        {
            background-color: #dff0d8;
            border-color: #d6e9c6;
        }
        .alert-success, .alert-success .alert-heading
        {
            color: #468847;
        }
        .alert-danger, .alert-error
        {
            background-color: #f2dede;
            border-color: #eed3d7;
        }
        .alert-danger, .alert-error, .alert-danger .alert-heading, .alert-error .alert-heading
        {
            color: #b94a48;
        }
        .alert-info
        {
            background-color: #d9edf7;
            border-color: #bce8f1;
        }
        .alert-info, .alert-info .alert-heading
        {
            color: #3a87ad;
        }
        .alert-block
        {
            padding-top: 14px;
            padding-bottom: 14px;
        }
        .alert-block > p, .alert-block > ul
        {
            margin-bottom: 0;
        }
        .alert-block p + p
        {
            margin-top: 5px;
        }
        .label-info
        {
            background-color: #BCE8F1;
        }
        .label-info:hover
        {
            background-color: #BCE8F1;
        }
    </style>
    <script src="Scripts/jquery-ui-1.8.17.custom.min.js" type="text/javascript"></script>
    <%--Javascript for JQuery UI tabs and datepicker--%>
    <script type="text/javascript">

        $(function () {
            $("#tabs").tabs();
        });
               
    </script>
    <script src="Scripts/bootstrap-twipsy.js" type="text/javascript"></script>
    <script src="Scripts/bootstrap-popover.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <div style="width: 205px">
        <asp:Panel ID="pnlSideInfo" runat="server" Style="margin-top: 30px;" class="ui-widget-content ui-corner-all">
            <div style="width: 199px; margin-left: 2px; height: 37px; margin-top: 2px" class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
                <span style="float: left; padding: .7em 1em; text-decoration: none; text-align: left;
                    position: static; white-space: nowrap; font-size: 14px; font-family: Verdana, Arial, Sans-Serif;
                    border-collapse: collapse; font-weight: normal" class='ui-tabs'>Pricing info</span>
            </div>
            <div style="width: 197px; padding-top: 3px; padding-bottom: 3px; padding-left: 5px;
                margin-top: 5px; margin-bottom: 2px; margin-left: 2px;" class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active">
                <b>Search Engine Optimization</b><br />
                1 months - $400<br />
                3 months - $1000<br />
                6 months - $1800<br />
                1 year - $3300<br />
                <br />
                <b>Banner advertising</b><br />
                1 months - $100<br />
                3 months - $275<br />
                6 months - $500<br />
                1 year - $900<br />
                <br />
                <asp:LinkButton ID="lbAdDashboard" class="link" ForeColor="Blue" PostBackUrl="~/AdvertiseDashboard.aspx"
                    runat="server">View dashboard</asp:LinkButton>
            </div>
        </asp:Panel>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="tabs" style="width: 1000px">
        <ul>
            <li><a href="#search">Search Engine Optimization</a></li>
            <li><a href="#banner">Home Page Banner</a></li>
        </ul>
        <div id="search" style="width: 950px">
            <asp:Panel ID="pnlSEOSelectOutlets" runat="server" DefaultButton="btnNextSEO">
                <table style="width: 100%">
                    <tr>
                        <td width="100%" colspan="2">
                            <b style="color: #fe9901; font-size: 14pt">Step 1. Select Branches for search optimization</b>
                        </td>
                    </tr>
                    <tr>
                        <td width="60%">
                            <asp:Label ID="lblSearch" runat="server" Text="Search"></asp:Label>
                            <asp:TextBox ID="tbxSearch" runat="server">
                            </asp:TextBox>
                            <asp:Button ID="btnSearch" Style="margin-left: 15px" class="btn primary" runat="server"
                                Text="Search" />
                        </td>
                        <td width="40%">
                            Selected branches:
                        </td>
                    </tr>
                    <tr>
                        <td width="600px">
                            <asp:Panel ID="pnlSearchResult" runat="server">
                                <asp:ListView ID="lvSearchResults" runat="server" DataSourceID="SqlDataSourceSearchResult"
                                    DataKeyNames="outlet_ID">
                                    <EmptyDataTemplate>
                                        <span>No data was returned.</span>
                                    </EmptyDataTemplate>
                                    <ItemTemplate>
                                        <table style="margin-bottom: 5px; margin-top: 5px">
                                            <tr>
                                                <td width="400px" style="padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; border-top: 0px">
                                                    <asp:LinkButton ID="lbName" rel="popover" data-content='<%# Eval("details") %>' data-original-title='<%# Eval("category") %>'
                                                        Style="color: blue" Text='<%# string.concat(Eval("name")," - ", Eval("outletName")) %>'
                                                        runat="server" CommandName="select" />
                                                    <asp:Label ID="lblName" rel="popover" data-content='<%# Eval("details") %>' data-original-title='<%# Eval("category") %>'
                                                        runat="server" Text='<%# string.concat(Eval("name")," - ", Eval("outletName")) %>' />
                                                    <asp:Label ID="lblOutletID" Visible="false" runat="server" Text='<%# Eval("outlet_ID") %>' />
                                                    <asp:Label ID="priorityLabel" Visible="false" runat="server" Text='<%# Eval("priority") %>' />
                                                </td>
                                                <td width="110px" style="padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; border-top: 0px">
                                                    <asp:Label ID="lblPrioritized" class="label important" Style="color: white" runat="server"
                                                        Text="Already Sponsored"></asp:Label>
                                                    <asp:Label ID="lblAvailable" class="label success" Style="color: white" runat="server"
                                                        Text="Available"></asp:Label>
                                                </td>
                                            </tr>
                                        </table>
                                    </ItemTemplate>
                                    <GroupTemplate>
                                        <span id="itemPlaceholder" runat="server"></span>
                                    </GroupTemplate>
                                    <LayoutTemplate>
                                        <div>
                                            <span id="groupPlaceholder" runat="server"></span>
                                            <table>
                                                <tr>
                                                    <td width="400px" style="padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; border-top: 0px">
                                                    </td>
                                                    <td width="110px" style="padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; border-top: 0px">
                                                        <asp:DataPager ID="DataPager1" runat="server">
                                                            <Fields>
                                                                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False"
                                                                    ShowPreviousPageButton="False" />
                                                                <asp:NumericPagerField />
                                                                <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False"
                                                                    ShowPreviousPageButton="False" />
                                                            </Fields>
                                                        </asp:DataPager>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </LayoutTemplate>
                                </asp:ListView>
                                <asp:SqlDataSource ID="SqlDataSourceSearchResult" runat="server" ConnectionString="<%$ ConnectionStrings:yijungoodAnotDBConnectionString %>"
                                    SelectCommand="SELECT DISTINCT business.name, outlet.name AS outletName, business.category, business.details, outlet.priority, outlet.outlet_ID FROM business INNER JOIN outlet ON business.business_ID = outlet.business_ID WHERE (business.name LIKE '%' + @search + '%') OR (outlet.name LIKE '%' + @search + '%')">
                                    <SelectParameters>
                                        <asp:ControlParameter ControlID="tbxSearch" Name="search" PropertyName="Text" />
                                    </SelectParameters>
                                </asp:SqlDataSource>
                            </asp:Panel>
                        </td>
                        <td width="400px">
                            <asp:UpdatePanel ID="updatePnlSelectedItems" runat="server">
                                <ContentTemplate>
                                    <asp:Panel ID="pnlSelectedItems" runat="server">
                                        <asp:ListView ID="lvSelectedItems" runat="server" DataSourceID="SqlDataSourceSearchResult">
                                            <EmptyDataTemplate>
                                                <span>No data was returned.</span>
                                            </EmptyDataTemplate>
                                            <ItemTemplate>
                                                <div class="alert alert-info" style="padding-top: 4px; padding-bottom: 4px; margin-bottom: 2px">
                                                    <asp:LinkButton ID="lbDelete" CommandName="deleteTempItem" class="close" runat="server">x</asp:LinkButton>
                                                    <strong>
                                                        <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("name") %>' /></strong>
                                                </div>
                                                <asp:Label ID="temp_adv_IDLabel" Visible="false" runat="server" Text='<%# Eval("temp_adv_ID") %>' />
                                                <asp:Label ID="outlet_IDLabel" Visible="false" runat="server" Text='<%# Eval("outlet_ID") %>' />
                                            </ItemTemplate>
                                            <LayoutTemplate>
                                                <div id="itemPlaceholderContainer" runat="server" style="">
                                                    <span runat="server" id="itemPlaceholder" />
                                                </div>
                                            </LayoutTemplate>
                                        </asp:ListView>
                                        <asp:SqlDataSource ID="SqlDataSourceSelectedItems" runat="server" ConnectionString="<%$ ConnectionStrings:yijungoodAnotDBConnectionString %>"
                                            SelectCommand="SELECT * FROM [temp_adv] WHERE ([user_ID] = @user_ID)">
                                            <SelectParameters>
                                                <asp:Parameter Name="user_ID" Type="Int32" />
                                            </SelectParameters>
                                        </asp:SqlDataSource>
                                    </asp:Panel>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="lvSearchResults" EventName="ItemCommand" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="border-top: 0px">
                            <asp:Button ID="btnNextSEO" Style="position: absolute; right: 35px; bottom: 10px"
                                class="btn" runat="server" Text="Proceed to next step " />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="pnlSEOSelectDuration" Visible="false" runat="server" DefaultButton="btnSEONext">
                <table style="width: 100%; margin-bottom: 0px">
                    <tr>
                        <td width="100%" colspan="2">
                            <b style="color: #fe9901; font-size: 14pt">Step 2. Select duration of optimization</b>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:ListView ID="lvDuration" runat="server" DataSourceID="SqlDataSourceSelectedItemsDuration">
                                <ItemTemplate>
                                    <table style="margin-bottom: 0px">
                                        <tr>
                                            <td style="border-top: 0px">
                                                <asp:Label ID="temp_adv_IDLabel" runat="server" Visible="false" Text='<%# Eval("temp_adv_ID") %>' />
                                                <asp:Label ID="lblName" runat="server" Visible="false" Text='<%# Eval("name") %>' />
                                                <asp:Label ID="lblOutletID" runat="server" Visible="false" Text='<%# Eval("outlet_ID") %>' />
                                                <asp:Accordion ID="accDuration" runat="server" SelectedIndex="-1" FadeTransitions="true"
                                                    FramesPerSecond="40" TransitionDuration="250" AutoSize="None" RequireOpenedPane="false"
                                                    OnItemCommand="accDuration_ItemCommand" OnLoad="accDurationCreateControls">
                                                    <Panes>
                                                        <asp:AccordionPane ID="accDurationPane" runat="server">
                                                            <Header>
                                                                <div id="divHeader" class="alert alert-error" style="padding-top: 4px; padding-bottom: 4px;
                                                                    margin-bottom: 2px; width: 800px" runat="server">
                                                                    <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("name") %>' />
                                                                </div>
                                                            </Header>
                                                            <Content>
                                                                <div class="alert alert-block" style="padding-top: 4px; padding-bottom: 4px; margin-bottom: 2px">
                                                                    <table style="margin-bottom: 0px">
                                                                        <tr>
                                                                            <td style="border-top: 0px">
                                                                                <asp:Label ID="lblAccDuration" runat="server" Text="Select Duration:   "></asp:Label>
                                                                                <asp:DropDownList ID="ddlAccDuration" runat="server" Width="100px" AutoPostBack="True"
                                                                                    OnSelectedIndexChanged="ddlAccDuration_SelectedIndexChanged">
                                                                                    <asp:ListItem Value="1">1 Month</asp:ListItem>
                                                                                    <asp:ListItem Value="2">3 Months</asp:ListItem>
                                                                                    <asp:ListItem Value="3">6 Months</asp:ListItem>
                                                                                    <asp:ListItem Value="4">1 Year</asp:ListItem>
                                                                                </asp:DropDownList>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td style="border-top: 0px">
                                                                                <asp:Label ID="lblAccStartDate" runat="server" Text="Date : "></asp:Label>
                                                                                <asp:PlaceHolder ID="placeHolderTextBox" runat="server" ClientIDMode="AutoID"></asp:PlaceHolder>
                                                                                <%-- <asp:TextBox ID="tbxDatePicker" Style="width: 90px; height: 10px" runat="server"
                                                                                    CausesValidation="True" AutoPostBack="True" OnTextChanged="datepicker_datePicked"></asp:TextBox>--%>
                                                                                <asp:Label ID="lblAccEndDateTo" runat="server" Text=" to : "></asp:Label>
                                                                                <asp:Label ID="lblAccEndDate" runat="server" Text=""></asp:Label>
                                                                                <asp:Button class="btn" Style="position: absolute; right: 120px" ID="btnAccConfirm"
                                                                                    runat="server" Text="Confirm" CommandName="Confirm" Enabled="false" />
                                                                                <br />
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </div>
                                                            </Content>
                                                        </asp:AccordionPane>
                                                    </Panes>
                                                </asp:Accordion>
                                            </td>
                                            <td width="10px" style="border-top: 0px">
                                                <asp:Image ID="imgNotDone" ImageUrl="~/Styles/Images/small_cross.gif" Height="20px"
                                                    Width="20px" Style="padding-top: 4px" runat="server" />
                                                <asp:Image ID="imgDone" ImageUrl="~/Styles/Images/small_tick.gif" Height="20px" Width="20px"
                                                    Visible="false" Style="padding-top: 4px" runat="server" />
                                            </td>
                                            <td style="border-top: 0px">
                                                <asp:Label ID="lblSubCost" runat="server" Visible="false"></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                                <LayoutTemplate>
                                    <div id="itemPlaceholderContainer" runat="server" style="">
                                        <span runat="server" id="itemPlaceholder" />
                                    </div>
                                    <div style="">
                                    </div>
                                </LayoutTemplate>
                            </asp:ListView>
                        </td>
                    </tr>
                </table>
                <div class="row">
                    <div class="span4">
                    </div>
                    <div class="span5 offset10" style="margin-left: 850px">
                        <b>Total cost: $</b>
                        <asp:Label ID="lblTotalCostSEO" runat="server" Text="0"></asp:Label>
                    </div>
                </div>
                <div class="row">
                    <div class="span4">
                        <asp:Button ID="btnSEOBack" Style="margin-top: 5px" OnClick="btnSEOBack_Click" runat="server"
                            Text="Back" /></div>
                    <div class="span3" style="margin-left: 710px" class="alert alert-info">
                        <asp:Button ID="btnSEONext" Enabled="false" Style="margin-top: 5px" runat="server"
                            Text="Next Step" /></div>
                </div>
            </asp:Panel>
        </div>
        <asp:SqlDataSource ID="SqlDataSourceSelectedItemsDuration" runat="server" ConnectionString="<%$ ConnectionStrings:yijungoodAnotDBConnectionString %>"
            SelectCommand="SELECT * FROM [temp_adv] WHERE ([user_ID] = @user_ID)">
            <SelectParameters>
                <asp:Parameter Name="user_ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <div id="banner">
            <table style="width: 100%">
                <tr>
                    <td width="100%" colspan="2">
                        <b style="color: #fe9901; font-size: 14pt">Step 1. Select banner listings</b>
                    </td>
                </tr>
                <tr>
                    <td width="525px">
                        <b>New banner</b>
                    </td>
                    <td width="450px">
                        <b>Selected banners</b>
                    </td>
                </tr>
                <tr>
                    <td width="525px">
                        <div class="alert alert-success">
                            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                <ContentTemplate>
                                    <asp:Label ID="lblStepOne" runat="server" Style="font-size: 9px; color: Red" Text="Step 1: Fill in required fields"></asp:Label>
                                    <br />
                                    <asp:Label ID="lblDate" Style="margin-bottom: 5px; margin-right: 25px" runat="server"
                                        Text="Select date "></asp:Label>
                                    <asp:TextBox ID="tbxBannerDate" runat="server" Height="15   px" Style="margin-bottom: 5px"
                                        AutoPostBack="True">
                                    </asp:TextBox>
                                    <br />
                                    <asp:CalendarExtender ID="calanderExtenderBanner" runat="server" TargetControlID="tbxBannerDate"
                                        Format='dd/MM/yyyy'>
                                    </asp:CalendarExtender>
                                    <asp:RequiredFieldValidator ValidationGroup="bannerNew" ID="rfvBannerDate" runat="server"
                                        ErrorMessage="Select a date" ControlToValidate="tbxBannerDate" Display="None">
                                    </asp:RequiredFieldValidator>
                                    <asp:ValidatorCalloutExtender ID="vceBannerReq" runat="server" TargetControlID="rfvBannerDate">
                                    </asp:ValidatorCalloutExtender>
                                    <asp:RangeValidator ID="rvBanner" runat="server" ErrorMessage="Must be at least 7 days in advance and within a year"
                                        ControlToValidate="tbxBannerDate" Type="Date" Display="none" ForeColor="White"
                                        ValidationGroup="bannerNew">
                                    </asp:RangeValidator>
                                    <asp:ValidatorCalloutExtender ID="vceBanner" runat="server" TargetControlID="rvBanner">
                                    </asp:ValidatorCalloutExtender>
                                    <asp:Label ID="lblDuration" Style="margin-bottom: 5px" runat="server" Text="Select Duration ">
                                    </asp:Label>
                                    <asp:DropDownList ID="ddlBannerDuration" runat="server" Style="margin-bottom: 5px"
                                        AutoPostBack="True">
                                        <asp:ListItem Value="1">1 Month</asp:ListItem>
                                        <asp:ListItem Value="2">3 Months</asp:ListItem>
                                        <asp:ListItem Value="3">6 Months</asp:ListItem>
                                        <asp:ListItem Value="4">1 Year</asp:ListItem>
                                    </asp:DropDownList>
                                    <br />
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="btnSubmitBanner" EventName="Click" />
                                </Triggers>
                            </asp:UpdatePanel>
                            <asp:UpdatePanel ID="updatePnlBannerNew" runat="server">
                                <ContentTemplate>
                                    <asp:Label ID="lblEndDate" Style="margin-bottom: 8px" runat="server" Text="End Date :">
                                    </asp:Label>
                                    <asp:Label ID="lblEndDateData" Style="margin-bottom: 8px; margin-left: 35px" runat="server"
                                        Text="">
                                    </asp:Label>
                                    <br />
                                    Cost : $
                                    <asp:Label ID="lblCost" runat="server" Text=""></asp:Label>
                                    <br />
                                    <asp:Label ID="lblStepTwo" runat="server" Style="font-size: 9px; color: Red" Text="Step 2: Upload and image and preview it"></asp:Label>
                                    <br />
                                </ContentTemplate>
                                <Triggers>
                                    <asp:PostBackTrigger ControlID="tbxBannerDate" />
                                    <asp:PostBackTrigger ControlID="ddlBannerDuration" />
                                </Triggers>
                            </asp:UpdatePanel>
                            <asp:Label ID="lblUpload" runat="server" Style="margin-right: 8px" Text="Upload Banner ">
                            </asp:Label>
                            <asp:FileUpload ID="FileUpload1" runat="server" Style="margin-bottom: 5px" ViewStateMode="Enabled"
                                Width="230px" />
                            <asp:Button class="btn" ID="btnImageUpload" runat="server" Text="Upload" Style="margin-left: 5px;
                                margin-top: 4px; padding: 0px 0px 0px 0px; height: 20px; width: 60px" />
                            <asp:RegularExpressionValidator ID="revFileUpload" runat="server" Display="None"
                                ErrorMessage="Invalid file format, only jpg/jpeg/gif/bmp files allowed" ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.jpg|.JPG|.gif|.GIF|.jpeg|.JPEG|.bmp|.BMP|.png|.PNG)$"
                                ControlToValidate="FileUpload1" ValidationGroup="bannerNew" />
                            <asp:ValidatorCalloutExtender ID="vceFileupload" runat="server" TargetControlID="revFileUpload">
                            </asp:ValidatorCalloutExtender>
                            <br />
                            <asp:Label ID="lblUploadInfo" runat="server" Style="margin-bottom: 5px" ForeColor="#77c779"
                                Text="Dimensions : [970px x 280px]"></asp:Label>
                            <br />
                            <asp:Label ID="lblUploadInfo2" runat="server" Style="margin-bottom: 5px" ForeColor="#77c779"
                                Text="Image Formats accepted : jpg, jpeg, gif, bmp"></asp:Label>
                            <br />
                            <asp:Label ID="lblStep3" runat="server" Style="font-size: 9px; color: Red" Text="Step 3: Search for outlet to link to"></asp:Label>
                            <br />
                            Search outlet:
                            <asp:TextBox ID="tbxSearchBannerOutlet" runat="server" AutoPostBack="True"></asp:TextBox>
                            <br />
                            <asp:Label ID="lblStep4" runat="server" Style="font-size: 9px; color: Red" Text="Step 4: Select an outlet for the image's hyperlink"></asp:Label>
                            <br />
                            <asp:UpdatePanel ID="updateSearchBanner" runat="server">
                                <ContentTemplate>
                                    <asp:ListView runat="server" ID="lvSearchBanner" DataKeyNames="outlet_ID" DataSourceID="SqlDataSourceSearchResultBanner">
                                        <ItemTemplate>
                                            <span style="">
                                                <asp:Label ID="outlet_IDLabel" Visible="false" runat="server" Text='<%# Eval("outlet_ID") %>' />
                                                <asp:LinkButton ID="nameLabel" Style="color: #468847" Text='<%# string.concat(Eval("businessName")," - ", Eval("name")) %>'
                                                    runat="server" CommandName="selectOutlet" />
                                                <br />
                                            </span>
                                        </ItemTemplate>
                                        <LayoutTemplate>
                                            <div id="itemPlaceholderContainer" runat="server" style="">
                                                <span runat="server" id="itemPlaceholder" />
                                            </div>
                                            <div style="">
                                                <asp:DataPager ID="DataPager1" runat="server">
                                                    <Fields>
                                                        <asp:NextPreviousPagerField ButtonType="Button" Visible="false" ShowFirstPageButton="True"
                                                            ShowLastPageButton="True" />
                                                    </Fields>
                                                </asp:DataPager>
                                            </div>
                                        </LayoutTemplate>
                                    </asp:ListView>
                                    <asp:SqlDataSource ID="SqlDataSourceSearchResultBanner" runat="server" ConnectionString="<%$ ConnectionStrings:yijungoodAnotDBConnectionString %>"
                                        SelectCommand="SELECT DISTINCT outlet.outlet_ID, outlet.name, business.name AS businessName FROM business INNER JOIN outlet ON business.business_ID = outlet.business_ID WHERE (outlet.name LIKE '%' + @search + '%') OR (business.name LIKE '%' + @search + '%')">
                                        <SelectParameters>
                                            <asp:ControlParameter ControlID="tbxSearchBannerOutlet" Name="search" PropertyName="Text" />
                                        </SelectParameters>
                                    </asp:SqlDataSource>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="tbxSearchBannerOutlet" EventName="TextChanged" />
                                </Triggers>
                            </asp:UpdatePanel>
                            <asp:Label ID="lblStep5" runat="server" Style="font-size: 9px; color: Red" Text="Step 5: Submit Banner"></asp:Label>
                            <br />
                            <asp:Button ID="btnSubmitBanner" class="btn" runat="server" Text="Submit" Enabled="false"
                                ValidationGroup="bannerNew" />
                        </div>
                    </td>
                    <td width="450px">
                        <asp:UpdatePanel ID="updatePnlSelectedBanner" runat="server">
                            <ContentTemplate>
                                <asp:ListView ID="lvSelectedBanner" runat="server" DataSourceID="SqlDataSourceSelectedBanner">
                                    <ItemTemplate>
                                        <div class="alert alert-info" style="padding-top: 4px; padding-bottom: 4px; margin-bottom: 2px"
                                            rel="popover" data-content='<%# string.concat(Eval("image_name"),"<br />","<b>Start Date : </b>", Eval("start_date","{0:dd/MM/yyyy}"),"<br /><b> End Date : </b>",Eval("end_date","{0:dd/MM/yyyy}"),"<br /> <b>Cost : $</b>", Eval("cost")) %>'
                                            data-original-title='More Details'>
                                            <asp:LinkButton ID="lbPreviewImage" Style="font-size: 10px; right: -7px; padding-top: 3px"
                                                CommandName="preview" class="close" runat="server">Preview</asp:LinkButton>
                                            <asp:LinkButton ID="lbDeleteBanner" CommandName="remove" Style="right: -75px;" class="close"
                                                runat="server">x</asp:LinkButton>
                                            <asp:Label ID="image_nameLabel" runat="server" Text='<%# Eval("image_name") %>' />
                                            <asp:Label ID="start_dateLabel" Visible="false" runat="server" Text='<%# Eval("start_date") %>' />
                                            <asp:Label ID="end_dateLabel" Visible="false" runat="server" Text='<%# Eval("end_date") %>' />
                                            <asp:Label ID="costLabel" Visible="false" runat="server" Text='<%# Eval("cost") %>' />
                                        </div>
                                        <asp:Label ID="adv_image_IDLabel" Visible="false" runat="server" Text='<%# Eval("adv_image_ID") %>' />
                                    </ItemTemplate>
                                    <LayoutTemplate>
                                        <div id="itemPlaceholderContainer" runat="server" style="">
                                            <span runat="server" id="itemPlaceholder" />
                                        </div>
                                        <div style="">
                                        </div>
                                    </LayoutTemplate>
                                </asp:ListView>
                                <asp:SqlDataSource ID="SqlDataSourceSelectedBanner" runat="server" ConnectionString="<%$ ConnectionStrings:yijungoodAnotDBConnectionString %>"
                                    SelectCommand="SELECT adv_image_ID, image_name, start_date, end_date, cost FROM adv_image WHERE (user_ID = @user_ID) AND (status = 'initialized') order by date_created asc">
                                    <SelectParameters>
                                        <asp:Parameter Name="user_ID" />
                                    </SelectParameters>
                                </asp:SqlDataSource>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="btnSubmitBanner" EventName="Click" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </td>
                </tr>
                <tr>
                    <td style="border-top: 0px">
                    </td>
                    <td style="border-top: 0px">
                        <asp:UpdatePanel ID="updatePanelTotalCost" runat="server">
                            <ContentTemplate>
                                <asp:Label ID="lblCostheader" Style="margin-left: 200px" runat="server" Text="Total Cost : $"></asp:Label>
                                <asp:Label ID="lblTotalCost" Width="60px" runat="server" Text=""></asp:Label>
                                <asp:Button ID="btnSubmitBannerComplete" Enabled="false" runat="server" Text="Confirm" /></ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="lvSelectedBanner" />
                                <asp:AsyncPostBackTrigger ControlID="btnSubmitBanner" EventName="Click" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <b>Preview Banner</b>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:UpdatePanel ID="updatePnlImagePreview" runat="server">
                            <ContentTemplate>
                                <asp:Image ID="imgPreview" Visible="false" runat="server" Width="970px" Height="280px"
                                    BorderColor="Black" BorderStyle="Solid" /></ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="lvSelectedBanner" EventName="ItemCommand" />
                                <asp:AsyncPostBackTrigger ControlID="lvSelectedBanner" EventName="ItemDataBound" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <script type="text/javascript">
        (function () {
            $("[rel=popover]").popover({ offset: 5, live: true, html: true });
        })(); 
    </script>
    <asp:HiddenField runat="server" ID="hidLastTab" Value="0" />
    <asp:HiddenField runat="server" ID="hfImageTemp" Value="0" />
    <script type="text/javascript" language="javascript">
    $(function() {
        $("#tabs").tabs({
            show: function() {
                var sel = $('#tabs').tabs('option', 'selected');
                $("#<%= hidLastTab.ClientID %>").val(sel);
            },
            selected: <%= hidLastTab.Value %>
        });
    });
    </script>
</asp:Content>
